# Django settings for ... project.
## 
## --------------------> Important <------------------------------------------##
## Settings in here may be over-ridden by select settings in a 
## 'local_settings.py' file.
## See the notes at the bottom of this file, and the notes in the 
## local_settings.py.template file (which is in the same directory as this
## file) for more details.
##----------------------------------------------------------------------------##
import os


DEBUG = True
TEMPLATE_DEBUG = DEBUG

CBV_DEBUG = True
## session length in seconds <wsl> fix this!
SESSION_COOKIE_AGE = 1209600 ## two weeks in seconds 

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

## 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = 'postgresql_psycopg2' 
## Or path to database file if using sqlite3.
DATABASE_NAME = 'wjcontact2'   
## Not used with sqlite3.         
DATABASE_USER = 'postgres_su' 
## Not used with sqlite3.          
DATABASE_PASSWORD = 'postgres_su' 
## Set to empty string for localhost. Not used with sqlite3.        
DATABASE_HOST = ''        
## Set to empty string for default. Not used with sqlite3.    
DATABASE_PORT = '' 

# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Etc/GMT-10'

# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
# http://blogs.law.harvard.edu/tech/stories/storyReader$15
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

## <wsl>  Added these next two settings to work with the part of the load_data 
## script which creates the site. The way the script works currently requires 
## the existence of these settings. It doesn't actually matter what values they 
## are set to (until we deploy), it only matters that they exist and have 
## *some* value. 
#SITE_NAME = "Wendy's Site"
#SITE_DOMAIN = "wendy.com"

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join( os.path.dirname(__file__), '../sitemedia/'),


# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
MEDIA_URL = '/sitemedia/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'wrpwn#v9guy$=^7s*s@ednfa^3&wjjnaxbim-xw-jn5y5!i01s'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    #"django.core.context_processors.media",
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
)

ROOT_URLCONF = 'formstates_wjContact.urls'

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    #"C:\Documents and Settings\wendy_admin\src\eclipse_workspace\djangodb\misc\wendy\wjContact\contacts\templates"
	os.path.join( os.path.dirname(__file__), 'templates'),
	os.path.join( os.path.dirname(__file__), 'contacts/templates'),
	os.path.join( os.path.dirname(__file__), 'computers/templates'),
	os.path.join( os.path.dirname(__file__), 'sales/templates'),
    )

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'formstates_wjContact.contacts',
    'formstates_wjContact.computers',
    'formstates_wjContact.sales',
    'formstates_wjContact.cbv_tags',
)

##LOGIN_URL = "/cbv_accounts/login/"
##LOGIN_URL = "/accounts/login/"


## The values we have set so far apply to all installations. We will now 
## update these with any extra settings which are relevant only for a local 
## machine, and also over-ride any values which are set here but which need to
## be changed for a local setup. See the notes in the 
## local_settings.py.template file for more about how this all works.
try:
    import local_settings as local_settings
    locals().update(local_settings.__dict__)
except ImportError: 
    msg = "Problem while importing local settings - no local_settings file "  \
          + "found! This may be ok, if you weren't intending to use a "       \
          + "seperate local settings file in the first place. The existence " \
          + "of a seperate local settings file was intended only for use "    \
          + "during development with multiple developers at cbv, and is "     \
          + "not related to the global_settings.py vs "                       \
          + "settings.py distinction used by django itself. If this is a "    \
          + "deployment version of the cbv software you probably shouldn't "  \
          + "be seeing this message. Since you are, feel free to complain "   \
          + "to one of the developers!" 
    print msg
    

    
 

